package editor.cn;
class Solution674{
    public static void main(String[] args) {
        Solution solution = new Solution674().new Solution();
        int [] nums=new int[]{2,1,3};

        System.out.println(solution.findLengthOfLCIS(nums));
    }
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int findLengthOfLCIS(int[] nums) {
        //    维护两个变量，一个最小值，一个最大值，每一个数，要比前面的最大值还要大，才能行。一旦不满足，直接丢弃。
        int n=nums.length;
        int currSubStrMax=nums[0];
        int currSubStrMaxLenIter=1;
        int currSubStrMaxLen=0;
        for (int i = 1; i < n; i++) {
            if (nums[i]>currSubStrMax){
                currSubStrMax=nums[i];
                currSubStrMaxLenIter++;
                currSubStrMaxLen= Math.max(currSubStrMaxLen,currSubStrMaxLenIter);

            }else{
                currSubStrMax=nums[i];
                currSubStrMaxLenIter=1;
            }
        }
        return Math.max(currSubStrMaxLen,currSubStrMaxLenIter);
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}












